
import {
    Service
} from "./request";

const apiData: object = {
    login: "login/",
    eneryConsumeGetDateEnery: "enery_consume/get_date_enery/",
    eneryConsumeEneryInformation: "enery_consume/enery_information/",
    powerQualityGetCab: "power_quality/get_cab/",
    powerQualityGetAlltrend: "power_quality/get_alltrend/",
    realData: "real_data/", 
    realMap: "real_map/",
    pvmGetAlldevice: "PVM/get_alldevice/",
    realFigure: "real_figure/",
    pvmQueryRate: "PVM/query_rate/",
    dataManageViewsParameterStatistics: "data_manage_views/parameter_statistics",
    transiantEvent:"transiant_event/",
    paramstatics:"paramstatics/",
    getAllname:"get_allname/",
    getHistoryData:"get_history_data/",
    
}
// 文件流下载api列表
const downloadBoldList = [""]
export function $Http(url: string, paramsData?: object, method?: string) {

    const http: object = {
        method: method,
        url: apiData[url],
        responseType: downloadBoldList.includes(url) && "arraybuffer"
    }
    http[(method === "post" || method === "put") ? "data" : "params"] = paramsData
    return Service(
        http
    )
}



